import { request } from 'umi';


/** 客服话术列表 */
export async function getCustomerServiceIdeas(id) {
  if(id == 'all'){
    return request(`/api/admin/storeservicespeechcrafts`, {
      method: 'GET',
    });
  }else {
    return request(`/api/admin/storeservicespeechcrafts`, {
      method: 'GET',
      params: {
        category_id:id
      }
    });
  }
}

/** 客服话术删除  */
export async function ServiceIdeasDelete(id) {
  return request(`/api/admin/storeservicespeechcrafts/${id}`, {
    method: 'DELETE',
  });
}


/** 客服话术 编辑修改  */
export async function serviceIdeasEdit(data) {
  return request(`/api/admin/storeservicespeechcrafts/${data.id}`, {
    method: 'PUT',
    data
  });
}

/** 用户留言 列表 */
export async function getGuestBook() {
  return request(`/api/admin/toreservicefeedback`, {
    method: 'GET'
  });
}

/** 话术 分类 的列表 */
export async function getFeedbackCategory() {
  return request(`/api/admin/feedback_category`, {
    method: 'GET'
  });
}

/** 话术 分类 的添加 */
export async function addFeedbackCategory(data) {
  return request(`/api/admin/feedback_category`, {
    method: 'POST',
    data
  });
}
